package com.reebake.ideal.message.websocket.core;

import com.reebake.ideal.message.websocket.entity.WebsocketMessageTransferDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;

public class DefaultWebsocketMessagePublisher implements WebsocketMessagePublisher {
    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    @Override
    public void sendMessage(WebsocketMessageTransferDTO message) {
        applicationEventPublisher.publishEvent(new WebSocketMessageBroadcastEvent(this, message));
    }
}
